import request from '@/utils/request'


export default{
    getChapters(courseId){
        return request({
            url: '/eduservice/chapter/allChapters/'+courseId,
            method: 'get'
          })
    },
    addChapter(chapter,courseId){
        return request({
            url: '/eduservice/chapter/addChapter/'+courseId,
            method: 'post',
            data: chapter
        })
    },
    updateChapter(chapter){
        return request({
            url: '/eduservice/chapter/updateChapter',
            method: 'post',
            data: chapter
        })
    },
    getChapterById(chapterId){
        return request({
            url: '/eduservice/chapter/getChapter/'+chapterId,
            method: 'get'
        })
    },
    deleteChapterById(chapterId){
        return request({
            url: '/eduservice/chapter/delete/'+chapterId,
            method: 'delete'
        })
    }
}